use a size group when allocating space for the buttons at the bottom just
authorJonathan Blandford <jrb@gnome.org>
Mon, 23 Feb 2004 22:56:55 +0000 (22:56 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Mon, 23 Feb 2004 22:56:55 +0000 (22:56 +0000)
Mon Feb 23 17:52:43 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (main_paned_create): use a size
        group when allocating space for the buttons at the bottom just in
        case.  Also, move the filter to below the file list.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c

index 77cc4393a4a6060146dd5bb495c13d81f1addf42..9d0f61c6aab67d8fede87219657de73a208e2e3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Feb 23 17:52:43 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (main_paned_create): use a size
+       group when allocating space for the buttons at the bottom just in
+       case.  Also, move the filter to below the file list.
+
 Mon Feb 23 16:52:12 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserdefault.c
index 77cc4393a4a6060146dd5bb495c13d81f1addf42..9d0f61c6aab67d8fede87219657de73a208e2e3b 100644 (file)
@@ -1,3 +1,9 @@
+Mon Feb 23 17:52:43 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (main_paned_create): use a size
+       group when allocating space for the buttons at the bottom just in
+       case.  Also, move the filter to below the file list.
+
 Mon Feb 23 16:52:12 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserdefault.c
index 77cc4393a4a6060146dd5bb495c13d81f1addf42..9d0f61c6aab67d8fede87219657de73a208e2e3b 100644 (file)
@@ -1,3 +1,9 @@
+Mon Feb 23 17:52:43 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (main_paned_create): use a size
+       group when allocating space for the buttons at the bottom just in
+       case.  Also, move the filter to below the file list.
+
 Mon Feb 23 16:52:12 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserdefault.c
index 77cc4393a4a6060146dd5bb495c13d81f1addf42..9d0f61c6aab67d8fede87219657de73a208e2e3b 100644 (file)
@@ -1,3 +1,9 @@
+Mon Feb 23 17:52:43 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (main_paned_create): use a size
+       group when allocating space for the buttons at the bottom just in
+       case.  Also, move the filter to below the file list.
+
 Mon Feb 23 16:52:12 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserdefault.c
index 77cc4393a4a6060146dd5bb495c13d81f1addf42..9d0f61c6aab67d8fede87219657de73a208e2e3b 100644 (file)
@@ -1,3 +1,9 @@
+Mon Feb 23 17:52:43 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (main_paned_create): use a size
+       group when allocating space for the buttons at the bottom just in
+       case.  Also, move the filter to below the file list.
+
 Mon Feb 23 16:52:12 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserdefault.c
index 73c1beb746a92409771abf00e5f3a4ee1b04d3a1..dd7c1a6f65c0416264e8abf8211a0cdef34114f1 100644 (file)
@@ -1049,13 +1049,16 @@ button_new (GtkFileChooserDefault *impl,
   GtkWidget *button;
   GtkWidget *hbox;
   GtkWidget *widget;
+  GtkWidget *align;
 
   button = gtk_button_new ();
-
   hbox = gtk_hbox_new (FALSE, 2);
-  gtk_container_add (GTK_CONTAINER (button), hbox);
+  align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
 
+  gtk_container_add (GTK_CONTAINER (button), align);
+  gtk_container_add (GTK_CONTAINER (align), hbox);
   widget = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
+
   gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
 
   widget = gtk_label_new (text);
@@ -1064,7 +1067,7 @@ button_new (GtkFileChooserDefault *impl,
   gtk_widget_set_sensitive (button, sensitive);
   g_signal_connect (button, "clicked", callback, impl);
 
-  gtk_widget_show_all (hbox);
+  gtk_widget_show_all (align);
 
   if (show)
     gtk_widget_show (button);
@@ -1426,7 +1429,8 @@ shortcuts_tree_create (GtkFileChooserDefault *impl)
 
 /* Creates the widgets for the shortcuts/bookmarks pane */
 static GtkWidget *
-shortcuts_pane_create (GtkFileChooserDefault *impl)
+shortcuts_pane_create (GtkFileChooserDefault *impl,
+                      GtkSizeGroup          *size_group)
 {
   GtkWidget *vbox;
   GtkWidget *hbox;
@@ -1443,6 +1447,7 @@ shortcuts_pane_create (GtkFileChooserDefault *impl)
   /* Box for buttons */
 
   hbox = gtk_hbox_new (TRUE, 6);
+  gtk_size_group_add_widget (size_group, hbox);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
   gtk_widget_show (hbox);
 
@@ -1550,9 +1555,27 @@ create_file_list (GtkFileChooserDefault *impl)
   return impl->list_scrollwin;
 }
 
+static GtkWidget *
+create_filename_entry_and_filter_combo (GtkFileChooserDefault *impl)
+{
+  GtkWidget *hbox;
+  GtkWidget *widget;
+
+  hbox = gtk_hbox_new (FALSE, 12);
+  gtk_widget_show (hbox);
+
+  /* Filter combo */
+
+  widget = filter_create (impl);
+  gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+
+  return hbox;
+}
+
 /* Creates the widgets for the files/folders pane */
 static GtkWidget *
-file_pane_create (GtkFileChooserDefault *impl)
+file_pane_create (GtkFileChooserDefault *impl,
+                 GtkSizeGroup          *size_group)
 {
   GtkWidget *vbox;
   GtkWidget *hbox;
@@ -1602,26 +1625,16 @@ file_pane_create (GtkFileChooserDefault *impl)
   gtk_box_pack_start (GTK_BOX (hbox), impl->preview_frame, FALSE, FALSE, 0);
   /* Don't show preview frame initially */
 
-  return vbox;
-}
-
-static GtkWidget *
-create_filename_entry_and_filter_combo (GtkFileChooserDefault *impl)
-{
-  GtkWidget *hbox;
-  GtkWidget *widget;
-
-  hbox = gtk_hbox_new (FALSE, 12);
+  /* Filename entry and filter combo */
+  hbox = gtk_hbox_new (FALSE, 0);
+  gtk_size_group_add_widget (size_group, hbox);
+  widget = create_filename_entry_and_filter_combo (impl);
+  gtk_box_pack_end (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
   gtk_widget_show (hbox);
 
-  /* Filter combo */
-
-  widget = filter_create (impl);
-  gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
-
-  return hbox;
+  return vbox;
 }
-
 /* Callback used when the "Browse for more folders" expander is toggled */
 static void
 expander_activate_cb (GtkExpander           *expander,
@@ -1708,7 +1721,10 @@ main_paned_create (GtkFileChooserDefault *impl)
 {
   GtkWidget *hpaned;
   GtkWidget *widget;
-  GtkWidget *entry_widget;
+  GtkSizeGroup *size_group;
+
+  /* size group is used by the [+][-] buttons, as well as the filter. */
+  size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
 
   /* Paned widget */
 
@@ -1717,19 +1733,14 @@ main_paned_create (GtkFileChooserDefault *impl)
 
   /* Shortcuts pane */
 
-  widget = shortcuts_pane_create (impl);
+  widget = shortcuts_pane_create (impl, size_group);
   gtk_paned_pack1 (GTK_PANED (hpaned), widget, FALSE, FALSE);
 
   /* File/folder pane */
 
-  widget = file_pane_create (impl);
+  widget = file_pane_create (impl, size_group);
   gtk_paned_pack2 (GTK_PANED (hpaned), widget, TRUE, FALSE);
 
-  /* Filename entry and filter combo */
-
-  entry_widget = create_filename_entry_and_filter_combo (impl);
-  gtk_box_pack_start (GTK_BOX (impl), entry_widget, FALSE, FALSE, 0);
-
   return hpaned;
 }